package StudyCode.summary.Basic.mystring;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class StringMatchNegativeDecimal {
	public static void main(String[] args) {
		System.out.println("0".matches("^[+-]?0$"));
		System.out.println("-A1000".matches("^-[0]\\.[1-9]*$|^-[1-9]\\d*\\.\\d*$"));
		System.out.println("1000.0".matches("^-[0]\\.[1-9]*$|^-[1-9]\\d*\\.\\d*$"));
		System.out.println("-1000.0".matches("^-[0]\\.[1-9]*$|^-[1-9]\\d*\\.\\d*$"));
		System.out.println("-A1000.0".matches("^-[0]\\.[1-9]*$|^-[1-9]\\d*\\.\\d*$"));
	}
}
